package Game;

import java.util.*;

/**
 * Represents the abstract idea of a level object.
 * 
 * @author YQ
 */
public abstract class AbstractLevel
{
	protected AbstractSprite[] myInitialPositions;
	protected Collection< String[] > mySpriteCollisionPairs;
	protected long myStartTime;
	
	public AbstractLevel( long startTime )
	{
		myStartTime = startTime;
	}
	
	public AbstractSprite[] getSpriteCollection()
	{
		return( myInitialPositions );
	}
	
	public Collection< String[] > getSpriteCollisionPairs()
	{
		return( mySpriteCollisionPairs );
	}
	
	/**
	 * Handles level events that are based on system time.
	 * 
	 * @param currentTime the current system time
	 */
	public abstract void timedEvent( long currentTime );
	
	/**
	 * Tells the engine whether or not the level has been cleared/completed.
	 * 
	 * @return true if the level gets cleared and false if the level has not been cleared
	 */
	public abstract boolean levelClear();
	
	/**
	 * Allows reactions from the level to a collision event.  They may be needed
	 * to see if the level is cleared.
	 * 
	 * @param a
	 * @param b
	 */
	public abstract void collision(AbstractSprite a, AbstractSprite b);
}